package org.ddd.orderdemo.query.service;

import org.ddd.orderdemo.query.assembler.OrderAssembler;
import org.ddd.orderdemo.query.pojo.OrderNoQuery;
import org.ddd.orderdemo.query.pojo.response.QuryOrderResponse;
import org.ddd.orderdemo.repository.po.OrderPo;
import org.ddd.orderdemo.repository.repository.mapper.OrderMapper;

import java.util.ArrayList;
import java.util.List;

public class OrderQueryService {

    private OrderMapper orderMapper;


    public List<QuryOrderResponse> getOrders(OrderNoQuery query) {

        List<String> orderNos = new ArrayList<>();

        List<OrderPo> orderPos = orderMapper.getOrders(orderNos);

        List<QuryOrderResponse> orderDtos = OrderAssembler.convertToDto(orderPos);

        return orderDtos;
    }
}
